/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx.controller;

import org.springframework.core.SpringVersion;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>Project: smvc2022 - IndexController
 * <p>Powered by webrx On 2022-04-08 11:31:25
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */

@RestController
public class IndexController {

    @GetMapping
    public String index() {
        return String.format("SpringMVC 中文效果 %s", SpringVersion.getVersion());
    }

    @PostMapping(value = {"/show"})
    public String show() {
        int i = 3 / 0;
        return String.format("SpringMVC 中文效果 %s", SpringVersion.getVersion());
    }

    @RequestMapping("/ok")
    public String ok() throws ClassNotFoundException {
        Class.forName("com.mysql.cj.jdbc.Drivers");
        return "ok";
    }


}
